package com.e2oto.seller.modules.seller.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

import com.e2oto.seller.modules.seller.ui.MineFragment;
import com.e2oto.seller.modules.seller.ui.OrderFragment;
import com.e2oto.seller.modules.seller.ui.OrderInnerFragment;
import com.e2oto.seller.modules.seller.ui.PendingFragment;
import com.e2oto.seller.modules.seller.ui.ShopFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ZhangLiQiang on 2017/9/15.
 */

public class OrderPageAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private String titles[] = {"进行中", "已完成", "退换货"};


    public OrderPageAdapter(FragmentManager fm) {
        super(fm);

        fragments = new ArrayList<>();
        fragments.add(new OrderInnerFragment(OrderInnerFragment.Status.ING));
        fragments.add(new OrderInnerFragment(OrderInnerFragment.Status.FINISH));
        fragments.add(new OrderInnerFragment(OrderInnerFragment.Status.RETURN));
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        //super.destroyItem(container, position, object);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
